home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / UTILITY / FDATE68A.ARJ / DO-ONCE.BAT < prev    next >
DOS Batch File  |  1992-07-30  |  2KB  |  49 lines

  1. @echo off
  2. cls
  3.  
  4. goto EndDoc
  5. ----------------------------------------------------------------------
  6. Run daily processing once a day.  Put this code in AUTOEXEC.BAT.
  7. This batch file requires DOS 3.3+, since it uses CALL.
  8.  
  9. If environment variable RAMDISK is set before running this batch
  10. file, then it will use the RAM disk and run a bit faster.
  11. ----------------------------------------------------------------------
  12. :EndDoc
  13. if not exist C:\LASTRUN.BAT goto RunNow
  14.  
  15. rem get the date when this was last run
  16. rem ------------------------------------------------------------------
  17. call C:\LASTRUN.BAT
  18.  
  19. rem compare the date when this was last run to today's date
  20. rem ------------------------------------------------------------------
  21. Fdate /Fcomp /At /B%LastRun% /P"@SET comp=" >%RAMDISK%JUNKTEMP.BAT
  22. call %RAMDISK%JUNKTEMP.BAT
  23. del  %RAMDISK%JUNKTEMP.BAT >nul
  24.  
  25. rem if today's date is greater than the date when this was last run,
  26. rem then run the once-a-day processing now
  27. rem ------------------------------------------------------------------
  28. IF (%COMP%)==(GT) goto RunNow
  29.                   goto NoRun
  30. :RunNow
  31.  
  32. rem First, record the fact that this processing was run today
  33. rem ----------------------------------------------------------------
  34. Fdate /Ff /Omm-dd-ccyy /At /P"@set LastRun=">C:\LASTRUN.BAT
  35.  
  36. rem Second, run the jobs that should be run only once a day.
  37. rem ----------------------------------------------------------------
  38.  
  39. REM  REPLACE THE FOLLOWING LINES WITH LINES TO RUN THE JOBS THAT YOU
  40. REM  WANT RUN ONCE A DAY...........
  41.  
  42. echo RUNNING ONCE A DAY PROCESSING: Job 1
  43. echo RUNNING ONCE A DAY PROCESSING: Job 2
  44. echo RUNNING ONCE A DAY PROCESSING: ............. etc.
  45.  
  46. :NoRun
  47. set LastRun=
  48. set comp=
  49.